﻿using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;
using Microsoft.Xna.Framework.Net;
using Microsoft.Xna.Framework.Storage;

namespace PedraPapelTesoura
{
    class Botão
    {
        private Vector2 Pos;
        private Texture2D Img, ImgSombra;
        
        public Vector2 pos
        {
            get { return Pos; }
        }
        public Texture2D img
        {
            get { return Img; }
        }
        public Texture2D imgSombra
        {
            get { return ImgSombra; }
        }

        public Botão(Texture2D img, Texture2D imgSombra, Vector2 pos)
        {
            this.Img = img;
            this.ImgSombra = imgSombra;
            this.Pos = pos;
        }

        public bool checarSombra()
        {
            bool sombraNovoJogo = false;
            if (Mouse.GetState().X > pos.X &&
                Mouse.GetState().X < pos.X + img.Width &&
                Mouse.GetState().Y > pos.Y &&
                Mouse.GetState().Y < pos.Y + img.Height)
            {
                sombraNovoJogo = true;
            }
            return sombraNovoJogo;
        }

        public bool checarClick(int contMouseClick)
        {
            bool clickNovoJogo = false;
            if (Mouse.GetState().X > pos.X &&
                Mouse.GetState().X < pos.X + img.Width &&
                Mouse.GetState().Y > pos.Y &&
                Mouse.GetState().Y < pos.Y + img.Height)
            {
                if (Mouse.GetState().LeftButton == ButtonState.Pressed && contMouseClick > 10)
                {
                    clickNovoJogo = true;
                }
            }
            return clickNovoJogo;
        }


    }
}
